package cn.easybuy.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.*;
import cn.easybuy.dao.ProductMapper;
import cn.easybuy.pojo.Product;

@Service
public class ProductServiceImpl implements ProductService{

	@Autowired
	ProductMapper productMapper;
	
	@Override
	public List<Product> getProductList(String epcChildId, Integer pageIndex, Integer pageSize) throws Exception{
		// TODO Auto-generated method stub
		System.out.println("================================"+epcChildId);
		return productMapper.getProductList(epcChildId, pageIndex, pageSize);
	}

	@Override
	public Product getProductById(Integer epId) throws Exception {
		// TODO Auto-generated method stub
		return productMapper.getProductById(epId);
	}

	@Override
	public int getProductCount(String epcChildId) throws Exception {
		// TODO Auto-generated method stub
		return productMapper.getProductCount(epcChildId);
	}

	@Override
	public int updataProduct(Product procuct) throws Exception {
		// TODO Auto-generated method stub
		return productMapper.updataProduct(procuct);
	}

	@Override
	public int addProduct(Product product) throws Exception {
		// TODO Auto-generated method stub
		return productMapper.addProduct(product);
	}

	@Override
	public int deleteProduct(Integer epId)throws Exception {
		// TODO Auto-generated method stub
		return productMapper.deleteProduct(epId);
	}

	@Override
	public List<Product> getProductAll()throws Exception {
		// TODO Auto-generated method stub
		return productMapper.getProductAll();
	}

}
